package com.cy.personer.biz.impl;

import com.cy.personer.bean.FirstMenu;
import com.cy.personer.bean.SecondMenu;
import com.cy.personer.biz.MenuBiz;
import com.cy.personer.ceptor.OperationLog;
import com.cy.personer.mapper.FirstMenuMapper;
import com.cy.personer.mapper.SecondMenuMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class MenuBizIpml implements MenuBiz {
    @Resource
    private FirstMenuMapper firstMenuMapper;
    @Resource
    private SecondMenuMapper secondMenuMapper;

    //查询一级菜单
    @OperationLog(operType="登录",methods = "加载菜单成功" )
    @Override
    public List<FirstMenu> queryFirstMenu(int roleId) {
        return firstMenuMapper.queryFirstMenu(roleId);
    }

    //查询二级菜单
    @Override
    public List<SecondMenu> querySecondMenu(int roleId) {
        return secondMenuMapper.querySecondMenu(roleId);
    }


    public FirstMenuMapper getFirstMenuMapper() {
        return firstMenuMapper;
    }

    public void setFirstMenuMapper(FirstMenuMapper firstMenuMapper) {
        this.firstMenuMapper = firstMenuMapper;
    }

    public SecondMenuMapper getSecondMenuMapper() {
        return secondMenuMapper;
    }

    public void setSecondMenuMapper(SecondMenuMapper secondMenuMapper) {
        this.secondMenuMapper = secondMenuMapper;
    }
}
